<?php 
$weekarr = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
$week = $weekarr[date("w")];
?>
<div id="company" class="indexcontentdiv">
    <div class="positiondiv">
        <table>
            <tr>
                <td class="td-left">
                    <img src="<?=base_url()?>resource/img/home_ico.png" width="21" height="17">
                    Report > <a href="<?=base_url()?>reminder/invoice">Invoice</a> > New Invoice
                </td>
                <td class="td-right">
                    <img src="<?=base_url()?>resource/img/menu2.png" width="27" height="24">Today is <?=$week?>,<?=date('M d,Y')?>
                </td>
            </tr>
        </table>
    </div>
    <div class="input-div">
        <?php echo form_open_multipart('reminder/newInvoice'); ?>
        <table>
            <tr><td></td><td><span class="err"><?=validation_errors();?><?php if(isset($error)){echo $error;}?></span></td></tr>
            <tr><td colspan="2"><h3>.SelfInfo</h3></td></tr>
            <tr><td class="nametd">Name:</td><td><input type="text" name="name" value="<?=$selfinfo['name']?>"/></td></tr>
            <tr><td class="nametd">Address:</td><td><input type="text" name="address" value="<?=$selfinfo['address']?>"/></td></tr>
            <tr><td class="nametd">Info:</td><td><input type="text" name="info" value="<?=$selfinfo['info']?>"/></td></tr>
            <tr><td class="nametd">Bank Account:</td><td><input type="text" name="bankaccount" value="<?=$selfinfo['bankaccount']?>"/></td></tr>
            <tr><td colspan="2"><h3>.Invoice</h3></td></tr>
            <tr><td class="nametd">No:</td><td><input type="text" name="no"/></td></tr>
            <tr><td class="nametd">Date:</td><td><input type="text" name="invoicedate"/></td></tr>
            <tr><td class="nametd">Client:</td><td><input type="text" name="client"/></td></tr>
            <tr><td class="nametd">Salesperson:</td><td><input type="text" name="salersperson"/></td></tr>
            <tr><td class="nametd">Contact:</td><td><input type="text" name="contact"/></td></tr>
            <tr><td class="nametd">Date Shipped:</td><td><input type="text" name="shippeddate"/></td></tr>
            <tr>
                <td class="nametd">Content:</td>
                <td>
                    <textarea name="content" style="resize:none;"></textarea>
                </td>
            </tr>
            <tr><td class="nametd">Unit Price:</td><td><input type="text" name="unitprice"/></td></tr>
            <tr><td class="nametd">Amount:</td><td><input type="text" name="amountprice"/></td></tr>
            <tr><td class="nametd">Sub Total:</td><td><input type="text" name="subtotal"/></td></tr>
            <tr><td class="nametd">Total Due:</td><td><input type="text" name="totaldue"/></td></tr>
            <tr>
                <td></td>
                <td>
                    <input type="submit" value="Save"/>
                </td>
            </tr>
        </table>
        <?php echo form_close(); ?>
    </div>
</div>
<script>
$("input[name='name']").focus(function(){
}).blur(function(){
    if($(this).val() == ''){
        alert("Name can not be empty！");
    }
});
</script>
　